<?php

class Controller_Pics extends Controller_Abstract
{
    function actionIndex()
    {
    }
    
    function actionDemo()
    {
    }
    function actionDemoiframe()
    {
    }
    
    function actionGetpic()
    {
    	if($this->_context->isGET()){
    		$catalogue = $this->_context->get('catalogue', null);	dump($catalogue);
    		$fileName = $this->_context->get('fileName', null);		dump($fileName);
    		if($catalogue && $fileName){
    			//$fileName = Util::UrlParamDecode($fileName);
    			foreach($catalogue as $k=>$v){
    				//$catalogue[$k] = Util::UrlParamDecode($v);
    			}
    			
    			header('Content-Type: image/gif');
	    		echo file_get_contents($this->_picsRoot . implode(DIRECTORY_SEPARATOR, $catalogue) . DIRECTORY_SEPARATOR . $fileName);
    			
    			exit();
    		}else{
    			exit();
    		}
    	}
    }
    
}

